﻿using Microsoft.Data.Objects;
using Model;

namespace Configuration.ModelConfiguration
{
    public class tkntCategoryConfiguration : EntityConfiguration<tkntCategory>
    {
        public tkntCategoryConfiguration()
        {
            Property(c => c.Id).IsIdentity();
            Property(c => c.Image).HasMaxLength(500).IsRequired();
            Property(c => c.ViName).HasMaxLength(500).IsRequired();
            Property(c => c.EnName).HasMaxLength(500).IsRequired();
            Relationship(c => c.Products).IsOptional().FromProperty(p => p.Category);
        }
    }
}